﻿namespace PicFingerprint
{
    using System;
    using System.Collections.Generic;

    class PicInfoGroup : IComparable<PicInfoGroup>
    {
        internal bool Duplicated { get; set; }
        internal List<PicInfo> Pics { get { return pics; } }

        private List<PicInfo> pics;

        public int CompareTo(PicInfoGroup p)
        {
            if (pics.Count != p.pics.Count)
            {
                return p.pics.Count.CompareTo(pics.Count);
            }
            for (int i = 0; i < pics.Count; ++i)
            {
                if (pics[i] != p.pics[i])
                {
                    return pics[i].CompareTo(p.pics[i]);
                }
            }
            return 0;
        }

        internal PicInfoGroup()
        {
            Duplicated = false;
            pics = new List<PicInfo>();
        }

        internal void AddPic(PicInfo p)
        {
            pics.Add(p);
        }

        internal void Sort()
        {
            pics.Sort();
        }
    }
}
